package com.netease.nie.base.protocol;

/**
 * 返回状态
 * 
 * @author KingsHunter
 * 
 */
public class ResponseStat<T> {

    /** 应答状态 */
    private State state;

    /** 应答数据。每个服务的点自己定义，无论返回data的字段有多少，此必须为一对象 */
    private T data;

    public static class State {

        public State(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        /** 状态码, 200开头表示正确，500表开头示出现异常 */
        public final Integer code;

        /** 状态码描述 */
        public final String msg;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
